﻿function geneDialog(e) {
	var name = {
		me:{
			id:"me",
			name: "新青年",
			avatar: "img/me.jpg"
			},
		zbl: {
			id: "zbl",
			name: "周本琳",
			avatar: "img/zbl.jpg"
		},
		xbl: {
			id: "xbl",
			name: "项保来",
			avatar: "img/xbl.jpg"
		},
		
	};
	_members = $.extend(_members, name),
	
	_dialog.d0 = [{
		type: "system",
		content:  "抗美援朝老兵夫妻的峥嵘岁月",
		pause: 2e3
	},
	{
		type: "system",
		content: "在黄岩，有一对抗美援朝老兵夫妻，丈夫项保来和妻子周本琳。他们双双亲历了战火纷飞的日子，因共同的经历而结缘。"
	},{
		type:"system",
		content:"项保来，男，祖籍杭州市淳安县，1934年10月出生，1949年5月参军，1950年10月—1952年10月参加抗美援朝，1962年起在黄岩五交化公司工作，1994年光荣离休。",
		pause: 2000
		},
		{
		type:"system",
		content:"周本琳，女，祖籍上海市青浦区，1934年3月出生，1950年3月27日参军，1951年2月—1952年10月参加抗美援朝。1958年7月入党，1970年-1989年，先后在黄岩冷冻厂、市一医工作，1989年4月光荣离休。",
		pause: 2e3
		},
		{
		type:"system",
		content:"周本琳加入了群聊",
		pause: 2e3
		},{
		type:"system",
		content:"项保来加入了群聊",
		pause: 2e3
		},
		{
		type: "plain",
		author: _members.zbl,
		content: "你好",
		pause: 2e3
	},
	{
		type: "plain",
		author: _members.zbl,
		content: "想了解啥尽管问吧",
		pause: 2e3
	},
		{
		type: "plain",
		author: _members.xbl,
		content: "知道你们要来，我早就准备好了。",
		pause: 2e3
	},{
		type: "plain",
		author: _members.me,
		content: "您二老好",
		pause: 2e3
	}],
	
	
	
	_dialog.d1 = [{
		type: "plain",
		author: _members.me,
		content: "可以描述一下您当时的行军之路吗？",
		pause: 3000
	},{
		type:"plain",
		author: _members.xbl,
		content:"那个时候，老百姓山沟沟里的房子都用油布全部给它封闭的，不透光的，透光了上面飞机就要扔炸弹了，不透光的，什么灯呢？气油灯，打气，照得很亮的！气油灯，开刀没日没夜开！我们一般都坚持三天三夜！都这样子的，不能睡觉的！每个山口美国飞机都飞行来，飞来咣咣咣，炸弹扔几颗就走了，就这样子的！你碰到炸弹扔到你头上，你就完了！你看到真是可怜得不得了，眼泪流干了！看到我们想起来眼泪流下来，我们有的战友死得非常可怜，那些都是16—17岁，20岁的小伙子！",
		pause: 6000
		},{
		type:"plain",
		author: _members.zbl,
		content:"我曾两次前往朝鲜，第一次是在二次战役后，第二次则是在1951年9月。丈夫则是经历了二次战役到五次战役……",
		pause: 2000
		},
		
		/*{
		type: "picture",
		author: _members.zbl,
		content: "img/1.jpg",
		pause: 2e3
	},*/
	{
		type: "plain",
		author: _members.zbl,
		content: "我到朝鲜后第一次看到照明弹，它好大、好亮，将阵地照得如同白昼……",
pause: 2e3
	},{
		type: "plain",
		author: _members.zbl,
		content: "到了朝鲜那会儿正好是冬天，冰天雪地下，合适的遮挡物并不那么容易找到，所以保持隐蔽就变得非常困难。",
pause: 2e3
	},{
		type:"system",
		content:"周本琳回忆道-当时的“行军之路”并不是那么容易。枪林弹雨下，敌军的飞机24小时都在空中盘旋，为了不丢掉性命，神经就得“一直紧绷着”。",
		pause: 2e3
		},{
		type:"plain",
		author: _members.xbl,
		content:"我们在朝鲜的时候，一不怕苦二不怕死，就是一个目标，胜利！",
		pause: 2e3
		},{
		type:"plain",
		author: _members.zbl,
		content:"我们部队在行军路上就像一家人一样，互相给予帮助、互相激励，什么都不怕",
		pause: 2e3
		},{
		type:"system",
		content:"点击继续提问"
		}],
		
	_dialog.d2 = [{
		type: "plain",
		author: _members.me,
		content: "在行军路上有什么您记忆深刻的事吗？",
		pause: 2000
	},{
		type: "plain",
		author: _members.xbl,
		content: "一次在战场，敌人的飞机来了，这个时候那边一匹马，牵马的人没有牵好，马跑了，跑了后飞机看到了，然后火箭炮就开始扫射，结果就在我旁边，我的伤员这个肩胛骨被飞机火箭炮打穿了，这个火箭炮洞有这么大，飞机子弹很大的，流血他说不行了，我说怎么，他说这里打了，我赶快把急救包拿出来，一个劲地帮着止血，不止血没用的，血流的，就这样子，把血止住了，捏好了，我的心都在跳，不要出问题，出了问题，我都没办法交代。你想想看，多少危险，就在我旁边，这一次。还有一次炸弹炸离我20多米，多少危险，我如果迟一点，就去了！",
		pause: 6000
	},
	{
		type: "plain",
		author: _members.zbl,
		content: "我还记得我们部队有个小姑娘，和我一般大。当时大家的关系都不错，那个小姑娘经常教我们唱歌，她牺牲的时候我印象很深……",
		pause: 2000
	},{
		type: "plain",
		author: _members.xbl,
		content: "过了这么久，朝鲜的冬日至今令我印象深刻",
		pause: 2e3
	},
	
	
	{
		type: "system",
		content: "点击继续提问"
		}],
_dialog.d3 = [{
		type: "plain",
		author: _members.me,
		content: "当时您觉得最可怕的事是什么？",
		pause: 2e3
	},
	{
		type: "plain",
		author: _members.xbl,
		content: "当时，比子弹更可怕的是寒冷。",
		pause: 2e3
	}],
		
	_dialog.d4 = [{
		type: "plain",
		author: _members.me,
		content: "是什么让您在如此艰苦的条件下坚持下来的?",
		pause: 2e3
	},
	{
		type: "plain",
		author: _members.zbl,
		content: "累的时候，我就想红军长征的故事，红军的精神指引着我，坚持不懈地向前进。",
		pause: 2e3
	},
/*	{
		type: "picture",
		author: _members.lwq,
		content: _imgUrl + "d-4-specs.jpg"
	},*/
	{
		type: "plain",
		author: _members.zbl,
		content: "能从战场活着回来已是幸运，见证国家日益强大，真是太幸福了。"
	},
	{
		type: "system",
		content: "几十年后的今天，战场的硝烟已经远去，但是中国志愿者的精神铸成了永恒，在那些炮火连天的日子，志愿军们前赴后继、不畏艰险的精神流传下来，成为激励一代又一代中国人前进的力量。正是有着千千万万像项保来、周本琳这样不计回报、为国奋战的战士们，才有了我们如今和平、幸福的生活。正值中国人民志愿军抗美援朝出国作战70周年之际，向这些伟大的志愿者战士们献上崇高的敬意，感恩他们的伟大付出。请点击继续提问",
		pause:4000
	}],
	
	
	_dialog.d5 = [{
		type: "plain",
		author: _members.me,
		content: "能看看您最满意的功勋吗？"
	},
	{
		type: "plain",
		author: _members.zbl,
		content: "这些老照片和勋章，是我最值得珍藏的东西",
		pause: 4e3
	},
	{
		type: "picture",
		author: _members.zbl,
		content: "img/2.jpg",
		pause: 3e3
	},
	{
		type: "plain",

		author: _members.me,
		content: "好厉害，这就是二老传奇的一生！",
		pause: 150
	},
	{
		type: "picture",
		author: _members.xbl,
		content:  "img/3.jpg",
		pause: 4e3
	},
	{
		type: "plain",
		author: _members.xbl,
		content: "这是我们的遗体捐赠书，不管到了何时，我们都永远跟党走，听党话，为党献身！",
		pause: 2000
	},{
		type: "plain",
		author: _members.xbl,
		content: "祖国的未来是你们的，你们肩负的责任也是很重大的，因为前面那些人牺牲，是为了国家更好，你们要接下去，使国家更好！我心里有这个信念，共产党是教育了我，使我懂得跟着共产党走，就是革命，跟着共产党走，永远是前进的。一辈子都要听党的话，跟党走，这个信念是永远不动摇的！",
		pause: 4000
	},{
		type: "plain",
		author: _members.me,
		content: "听了您的话，我深有感触！！"
	},{
		type: "system",
		content: "点击继续提问"
		}],
	
	
	
	
	
	/*
	_dialog.d6 = [{
		type: "plain",
		author: _members.me,
		content: "咋买呢"
	},
	{
		type: "plain",
		author: _members.lb,
		content: "这个我来回答，小米网5月17日周二首批开售3GB+32GB版本，小米之家17日也同步开售哦",
		pause: 2500
	},
	{
		type: "picture",
		author: _members.lb,
		content: _imgUrl + "d-6-fcode.jpg",
		pause: 2e3
	},
	{
		type: "plain",
		author: _members.ld,
		content: "我也没有" + gif.cry + gif.cry + gif.cry
	},
	{
		type: "plain",
		author: _members.kk,
		content: "我也没有" + gif.cry + gif.cry
	},
	{
		type: "plain",
		author: _members.lb,
		content: "除了小米网和小米之家，天猫、京东、苏宁等电商平台都能买到哦，请多留意～"
	}],
	
	
	_dialog.d7 = [{
		type: "plain",
		author: _members.me,
		content: "彩蛋是什么呀？"
	},
	{
		type: "system",
		content: "沈腾加入群聊"
	},
	{
		type: "plain",
		author: _members.st,
		content: "彩蛋在这儿呢"
	},
	{
		type: "plain",
		author: _members.st,
		content: "哈哈哈" + gif.lol + gif.lol + gif.lol
	},
	{
		type: "plain",
		author: _members.st,
		content: "我们和小米合作了一系列脑洞大开的大片，你要先看哪个？",
		pause: 2e3
	}],
	
	
	
	
	_dialog.d8 = [{
		type: "plain",
		author: _members.me,
		content: "我听了这么多，老板们发个红包呗"
	},
	{
		type: "system",
		content: "生态链刘德退出群聊",
		pause: 500
	},
	{
		type: "system",
		content: "小米网林斌退出群聊",
		pause: 400
	},
	{
		type: "system",
		content: "MIUI洪锋退出群聊",
		pause: 700
	},
	{
		type: "system",
		content: "小米电视王川退出群聊",
		pause: 400
	},
	{
		type: "system",
		content: "小米路由云KK退出群聊",
		pause: 500
	},
	{
		type: "system",
		content: "手机研发周光平退出群聊",
		pause: 1500
	},
	{
		type: "plain",
		author: _members.lwq,
		content: "哈哈，大家开个玩笑，微信公众号现在不允许H5发红包了哦.."
	},
	{
		type: "plain",
		author: _members.lwq,
		content: "但是到16号为止，小米网有预约赢手机的活动，每2小时抽1台，你可以去小米网看看"
	},
	{
		type: "plain",
		author: _members.lwq,
		content: "说不定会中手机呢"
	}],
	*/
	
	
	
	_dialog.d9 = [{
		type: "plain",
		author: _members.me,
		content: "谢谢二老的回答，我现在对抗美援朝有了更清晰的认识，都是因为你们，我们后辈得以繁荣富强！"
	},
	{
		type: "plain",
		author: _members.zbl,
		content: "嗯嗯"
	},
	{
		type: "plain",
		author: _members.xbl,
		content: "不客气，再见！",
		pause:3000
	},
	{
		type: "system",
		content: "策划制作:赵阳光 谢乙田"
	},
	{
		type: "system",
		content: "内容来源:"
	},
	{
		type: "picture",
		author: _members.me,
		content: "img/source.png"
	},
	{
		type: "picture",
		author: _members.me,
		content: "img/source1.png"
	},
	{
		type: "picture",
		author: _members.me,
		content: "img/source2.png"
	}]
	
	
	
	
	
	
	
	
	
	
	/*_dialog.d1_1 = [{
		type: "plain",
		author: _members.me,
		content: "我比较关心屏幕多大"
	},
	{
		type: "plain",
		author: _members.wc,
		content: "比小米电视略小一点" + gif.lol
	},
	{
		type: "plain",
		author: _members.lwq,
		content: "屏到用时方恨小，大屏底下好乘凉" + _translate.replace("%placehold%", '6.44"黄金尺寸大屏，看什么都震撼'),
		pause: 3e3
	},
	{
		type: "plain",
		author: _members.lwq,
		content: "先来看看跟其他手机的对比"
	},
	{
		type: "picture",
		author: _members.lwq,
		content: _imgUrl + "d-1-contrast.jpg"
	},
	{
		type: "plain",
		author: _members.lj,
		content: "再给你欣赏几张美美的场景图",
		pause: 2e3
	},
	{
		type: "picture",
		author: _members.lj,
		content: _imgUrl + "d-sence-01.jpg"
	},
	{
		type: "picture",
		author: _members.lj,
		content: _imgUrl + "d-sence-02.jpg"
	},
	{
		type: "picture",
		author: _members.lj,
		content: _imgUrl + "d-sence-03.jpg",
		pause: 3500
	},
	{
		type: "plain",
		author: _members.lj,
		content: "怎么样？还不错吧，小米Max其他方面也很赞，你对哪方面感兴趣？"
	}],
	_dialog.d1_2 = [{
		type: "plain",
		author: _members.me,
		content: "既然屏幕这么大，手机也很大吗，手感怎么样？"
	},
	{
		type: "plain",
		author: _members.lj,
		content: e + "，好问题，我们都想要大屏幕，但没人想要大手机。"
	},
	{
		type: "plain",
		author: _members.lb,
		content: "对，小米Max屏幕大，但是依然很轻薄"
	},
	{
		type: "picture",
		author: _members.lb,
		content: _imgUrl + "d-holdphone.jpg"
	},
	{
		type: "plain",
		author: _members.lwq,
		content: "我们跟其他手机做了对比，也让很多人试用了一下，你想看哪个？"
	}],
	
	_dialog.d1_2_1 = [{
		type: "plain",
		author: _members.me,
		content: "看看对比图，比较有感觉"
	},
	{
		type: "plain",
		author: _members.lwq,
		content: "对比图在这里，你感受一下"
	},
	{
		type: "picture",
		author: _members.lwq,
		content: _imgUrl + "d-1-contrast.jpg"
	}],
	_dialog.d1_2_2 = [{
		type: "plain",
		author: _members.me,
		content: "我比较想看看别人怎么说"
	},
	{
		type: "plain",
		author: _members.lwq,
		content: "我们在街上随机采访了一些人，问了他们的使用体验，发给你看看",
		pause: 2500
	},
	{
		type: "video",
		author: _members.lwq,
		content: {
			video: "http://v.qq.com/iframe/player.html?vid=p01993h0yaj&tiny=0&auto=0",
			poster: _imgUrl + "d-thumb-user.jpg"
		}
	}],
	_dialog.d2_1 = [{
		type: "plain",
		author: _members.me,
		content: "我觉得能放个30部影片已经很大了！"
	},
	{
		type: "plain",
		author: _members.wc,
		content: "那你可就小看小米Max了，它最大可是能放下700集左右的海贼王的！"
	},
	{
		type: "plain",
		author: _members.me,
		content: "果然是大容量啊！"
	}],
	_dialog.d2_2 = [{
		type: "plain",
		author: _members.me,
		content: "我觉得能放个80集美剧已经很牛了！"
	},
	{
		type: "plain",
		author: _members.wc,
		content: "那你可就小看小米Max了，它最大可是能放下700集左右的海贼王的！",
		pause: 3e3
	},
	{
		type: "plain",
		author: _members.me,
		content: "果然是大容量啊！"
	}],
	_dialog.d2_3 = [{
		type: "plain",
		author: _members.me,
		content: "既然容量这么大，应该能放一整部海贼王吧？"
	},
	{
		type: "plain",
		author: _members.wc,
		content: "你太厉害了，小米Max通过扩展卡最大存储达到256GB，700集左右的《海贼王》存进去杠杠的！",
		pause: 3e3
	},
	{
		type: "plain",
		author: _members.me,
		content: "果然是大容量啊！"
	}],
	_dialog.d7_1 = [{
		type: "plain",
		author: _members.st,
		content: "这个彩蛋很给力吧？你再问问老板们其他问题，我也一起了解一下。",
		pause: 2800
	}],
	_dialog.dr_1 = [{
		type: "plain",
		author: _members.lj,
		content: "还对啥感兴趣？可以继续问我们"
	}],
	_dialog.dr_2 = [{
		type: "plain",
		author: _members.lb,
		content: "小米Max的其他方面也很优秀，不信来问我们。"
	}],
	_dialog.dr_3 = [{
		type: "plain",
		author: _members.lwq,
		content: "再看看其他方面的特性吧，关于小米Max我们还有很多要跟你分享"
	}],
	_dialog.dv_1 = [{
		type: "plain",
		author: _members.lb,
		content: "怎么样？够大吗？"
	},
	{
		type: "plain",
		author: _members.me,
		content: "好大，好轻薄！小米的妹子也很美" + gif.lol + gif.lol + gif.lol
	},
	{
		type: "plain",
		author: _members.hf,
		content: "同感，哈哈..还有啥感兴趣的？"
	}],
	_dialog.dv_2 = [{
		type: "system",
		content: "视频通话已拒绝"
	},
	{
		type: "plain",
		author: _members.lwq,
		content: "了解点儿别的吧？"
	}],
	_dialog.dreg_1 = [{
		type: "plain",
		author: _members.lb,
		content: "赞！你已经成功预约了。5月17日可以到小米网来购买" + gif.lol
	}],
	_dialog.dreg_2 = [{
		type: "plain",
		author: _members.hf,
		content: "系统说预约失败，再点一下试试"
	}]*/
}
!function(e) {
	function t(e) {
		e = e || {},
		this.maxFlake = e.maxFlake || 200,
		this.flakeSize = e.flakeSize || 10,
		this.fallSpeed = e.fallSpeed || 2,
		this.emojiImage = e.emojiImage
	}
	function a() {
		var e = document.getElementById("emoji");
		this.canvas = e,
		this.ctx = e.getContext("2d")
	}
	function n() {
		for (var e = this.maxFlake,
		t = this.flakes = [], a = this.canvas, n = 0; e > n; n++) t.push(new r(a.width, a.height, this.flakeSize, this.fallSpeed, this.emojiImage))
	}
	function o() {
		var e = this.maxFlake,
		t = this.flakes;
		ctx = this.ctx,
		canvas = this.canvas,
		that = this,
		ctx.clearRect(0, 0, canvas.width, canvas.height);
		for (var a = 0; e > a; a++) t[a].update(),
		t[a].render(ctx);
		this.loop = l(function() {
			o.apply(that)
		})
	}
	function i() {
		var e = this.ctx,
		t = this.canvas;
		e && e.clearRect(0, 0, t.width, t.height)
	}
	function r(e, t, a, n, o) {
		this.x = Math.floor(Math.random() * e),
		this.y = Math.floor(Math.random() * t * 1.5) - 1.5 * t,
		this.size = Math.random() * a + 2,
		this.maxSize = a,
		this.speed = 1 * Math.random() + n,
		this.fallSpeed = n,
		this.velY = this.speed,
		this.velX = 0,
		this.stepSize = Math.random() / 30,
		this.step = 0,
		this.emojiImage = o
	}
	e.emojiFall = t;
	var l = e.requestAnimationFrame || e.mozRequestAnimationFrame || e.webkitRequestAnimationFrame || e.msRequestAnimationFrame || e.oRequestAnimationFrame ||
	function(e) {
		setTimeout(e, 1e3 / 60)
	},
	m = e.cancelAnimationFrame || e.mozCancelAnimationFrame || e.webkitCancelAnimationFrame || e.msCancelAnimationFrame || e.oCancelAnimationFrame;
	t.prototype.start = function() {
		a.apply(this),
		n.apply(this),
		o.apply(this)
	},
	r.prototype.update = function() {
		this.x,
		this.y;
		this.velX *= .98,
		this.velY <= this.speed && (this.velY = this.speed),
		this.velX += Math.cos(this.step += .05) * this.stepSize * 5,
		this.y += this.velY,
		this.x += this.velX
	},
	r.prototype.reset = function(e, t) {
		this.x = Math.floor(Math.random() * e),
		this.y = 0,
		this.size = Math.random() * this.maxSize + 2,
		this.speed = 1 * Math.random() + this.fallSpeed,
		this.velY = this.speed,
		this.velX = 0
	},
	t.prototype.stop = function() {
		this.pause(),
		i()
	},
	t.prototype.pause = function() {
		m(this.loop)
	},
	t.prototype.resume = function() {
		this.loop = l(function() {
			o.apply(that)
		})
	},
	r.prototype.render = function(e) {
		var t = new Image;
		t.src = this.emojiImage,
		t.complete ? e.drawImage(t, this.x, this.y, 84, 84) : (t.onload = function() {
			e.drawImage(t, this.x, this.y, 84, 84)
		},
		t.onerror = function() {})
	}
} (window);
var _imgUrl = "http://c1.mifile.cn/f/i/hd/2016051101/",
_userName = me.name,
_dialog = {},
_members = {},
_emoji = new emojiFall({
	maxFlake: 20,
	fallSpeed: 5,
	emojiImage: _imgUrl + "cry.gif"
}),
gif = {
	welcome: '<img src="' + _imgUrl + 'welcome.gif">',
	lol: '<img src="' + _imgUrl + 'lol.gif">',
	cry: '<img src="' + _imgUrl + 'cry.gif">'
},
_animation = {
	tour: $(".J_map").html()
},
_translate = '<span class="trans J_trans">点击翻译</span><span class="hide J_actualContent">%placehold%</span>';
$.fn.loadingMask = function() {
	var e = this,
	t = e.css("position").toLowerCase();
	"relative" != t && "absolute" != t && "fixed" != t && e.css("position", "relative"),
	e.css("minHeight", 100);
	var a = $('<div class="loading"><div class="loader loader-white"></div></div>').appendTo(e);
	return function() {
		a.remove(),
		e.css("position", t)
	}
},
$.fn.scrollSmooth = function(e, t) {
	function a() {
		var e = Math.min(1, (Date.now() - l) / t);
		o.scrollTop = r * e + i,
		1 > e && setTimeout(a, 10)
	}
	var n = this,
	o = n[0],
	i = o.scrollTop,
	r = e - i,
	l = Date.now();
	a()
},
$.fn.goSmooth = function(e, t) {
	function a() {
		var e = Math.min(1, (Date.now() - r) / t);
		n.css("margin-bottom", i * e + o),
		1 > e && setTimeout(a, 10)
	}
	var n = this,
	o = 1 * n.css("margin-bottom").replace("px", ""),
	i = e - o,
	r = Date.now();
	a()
},
$(document).ready(function() {
	function e() {}
	function t(t) {
		for (var a = new e,
		n = 0; n < t.length; n++) a.add(t[n]);
		return a
	}
	function a(e) {
		h.html(""),
		unmask = h.loadingMask();
		var t = new Image;
		t.onload = function() {
			var a = t.width,
			n = t.height,
			o = $(window).width(),
			i = $(window).height(); (n > i || a > o) && (n / a > i / o ? (a = a * i / n, n = i) : (n = n * o / a, a = o)),
			h.css({
				width: a,
				height: n,
				marginLeft: -a / 2,
				marginTop: -n / 2
			}),
			unmask && unmask(),
			unmask = null,
			h.append('<img src="' + e + '">')
		},
		t.src = e
	}
	function n() {
		_members.me = me
	}
	function o() {
		$(".J_mapWrapper").addClass("animate");
		var e = 0,
		t = setInterval(function() {
			e >= 9 ? ($(".J_tourtime").html(8), clearInterval(t)) : (e++, $(".J_tourtime").html(e % 9))
		},
		5e3 / 9)
	}
	function i() {
		$(".box_ft").find(".input-wrapper").addClass("J_inputWrapper")
	}
	function r() {
		$(".box_ft").find(".input-wrapper").removeClass("J_inputWrapper")
	}
	function l(e, a) {
		function n(e) {
			void 0 == e && (e = 1e3 * Math.random() + 600);
			var t = setTimeout(function() {
				if (l) {
					var e = m([l.el]);
					c.append(e),
					$("#message-push-music")[0].play();
					var r = $(".J_scrollContent").height(),
					s = c.height();
					if (s > r && $(".J_scrollContent").scrollSmooth(s - r + 16, 300), l.el.flag) {
						var p = l.el.flag;
						switch (p) {
//						case "emoji":
//							_emoji.stop(),
//							_emoji.start();
//							break;
//						case "emoji-welcome":
//							var h = new emojiFall({
//								maxFlake: 20,
//								fallSpeed: 9,
//								emojiImage: _imgUrl + "welcome.gif"
//							});
//							h.start();
//							break;
						case "playVideo":
							break;
						case "animate-tour":
							o();
							break;
						case "animate-train":
							setTimeout(function() {
								var e = $(".J_train").find("img"),
								t = e.attr("data-origin");
								e.attr("src", t),
								$(".J_train").addClass("animate"),
								$("#train-run-music")[0].play()
							},
							800),
							setTimeout(function() {
								$(".J_train").hide(),
								$("#train-run-music")[0].pause()
							},
							5e3)
						}
					}
					void 0 != l.el.pause ? n(l.el.pause) : n(),
					l = l._next
				} else i(),
				clearTimeout(t),
				a && a()
			},
			e)
		}
		r();
		var l = t(e)._first,
		m = doT.template($("#messageTpl").html());
		n(0)
	}
	function m(e, t) {
		$(".J_noticeInput").hide(),
		null === t && (t = 100),
		e || (e = "0"),
		setTimeout(function() {
			$(".J_choiceWrapper").addClass("opened").find(".J_choice").removeClass("choosen").hide(),
			$(".J_inputWrapper").addClass("opened");
			var t = $(".J_choiceWrapper").find(".J_choice").filter('[data-choice="' + e + '"]'),
			a = t.addClass("choosen").show().height(),
			n = $(".box_ft").height(),
			o = $("#chatContent").height();
			$(".box_bd").goSmooth(a, 100),
			$(".J_scrollContent").scrollSmooth(n + o, 300)
		},
		t)
	}
	function s() {
		$(".box_bd").goSmooth(0, 100),
		$(".J_inputWrapper").removeClass("opened"),
		$(".J_choiceWrapper").removeClass("opened")
	}
	function p() {
		n(),
		geneDialog(_userName),
		l(_dialog.d0,
		function() {
			$(".J_noticeInput").show()
		}),
		$(".box_ft").on("click", ".J_choice .J_liNext",
		function(e) {
			e.preventDefault();
			var t = $(this),
			a = t.attr("data-target-dialog"),
			n = t.attr("data-target-choice"),
			o = "false" !== t.attr("data-continue");
			$(".J_mainChoice").find('.J_liNext[data-target-dialog="' + a + '"]').addClass("disabled"),
			n || (n = "0"),
			s(),
			clearTimeout(window.waitUser),
			l(_dialog["d" + a],
			function() {
				o && (m(n, 500), window.waitUser = setTimeout(function() {
					var e = Math.floor(3 * Math.random() + 1);
					l(_dialog["dr_" + e])
				},
				3e4))
			}),
			$(".J_mainChoice").find(".J_liNext").not(".disabled") || clearTimeout(window.waitUser)
		}),
		$(document).on("click", ".J_inputWrapper",
		function() {
			var e = $(".J_choice").filter(".choosen").attr("data-choice");
			$(".J_choiceWrapper").hasClass("opened") ? s() : m(e, 0)
		}),
		$(document).on("click", ".J_img",
		function(e) {
			var t = $(this),
			n = t.attr("src").replace(/\.(jpg|jpeg|png|gif)/, "-hd.$1");
			n && (a(n), $("#J_fullPics").show())
		}),
		$(document).on("click", "#J_fullPics",
		function(e) {
			h.html("").attr("style", ""),

			$("#J_fullPics").hide()
		}),
		$(document).on("click", ".J_trans",
		function(e) {
			"true" != $(this).attr("translated") && $(this).html($(this).siblings(".J_actualContent").html()).attr("translated", "true")
		}),
		$(document).on("click", ".J_fpVideo",
		function(e) {
			var t = $(this).attr("data-src"),
			a = $(".J_videoOverlay");
			if (t) {
				var n = a.loadingMask(),
				o = document.createElement("iframe");
				o.onload = function() {
					n && n(),
					n = null
				},
				o.src = t,
				$(o).attr({
					frameborder: 0,
					allowfullscreen: !0
				}),
				$(".J_videoOverlay").show().find(".J_videoWrapper").append(o)
			}
		}),
		$(document).on("click", ".J_videoClose",
		function(e) {
			$(".J_videoOverlay").hide().find(".J_videoWrapper").html("")
		}),
		$(document).on("click", ".J_galleryShow",
		function(e) {
			$(".J_galleryOverlay").filter('[data-gallery="1"]').show(),
			$(".J_gallerySlide").css({
				"line-height": $(window).height() + "px"
			}),
			$(".J_gallerySlide").find("img").each(function(e, t) {
				var a = $(t).attr("data-origin");
				a && $(t).attr("src", a)
			}),
			XIAOMI.app.slide({
				slideObj: ".J_gallerySlide",
				edgeType: "rollback",
				autoPlay: !1
			});
			var t = $(".J_galleryClose"),
			a = $(".J_galleryOverlay");
			t.on("click",
			function() {
				a.hide()
			})
		})
	}
	var c = $("#chatContent"),
	h = $("#J_fullPics .pic");
	e.prototype = {
		add: function(e) {
			return this._last ? this._last = this._last._next = {
				el: e,
				_next: null
			}: this._last = this._first = {
				el: e,
				_next: null
			},
			this
		}
	},
	p()
});